#ifndef SQL_QUERY_H
#define SQL_QUERY_H

#include <QtCore/QObject>
#include <QtCore/QString>
#include <QtSql/QSqlQuery>

namespace smsbilling {

class QueryHandler;

class SqlQuery : public QObject {
  Q_OBJECT
public:
  SqlQuery(bool return_result = true,
           bool use_transaction = false);

  ~SqlQuery();

  void add(const QString &query);

  bool success;

  bool use_transaction;

  bool return_result;

  QList<QString> queries;

  QList<QSqlRecord> records;

  int fault_code;

  QString fault_string;

signals:

  void executed();

private:

  friend class QueryHandler;

};

} // namespace smsbilling

#endif // SQL_QUERY_H
